/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.uhk.ppro.response.service;

import cz.uhk.ppro.response.form.StudentsCourses;
import cz.uhk.ppro.response.model.Answer;
import cz.uhk.ppro.response.model.Course;
import cz.uhk.ppro.response.model.Question;
import cz.uhk.ppro.response.model.Student;
import cz.uhk.ppro.response.model.Teacher;
import cz.uhk.ppro.response.model.Test;
import cz.uhk.ppro.response.model.Types;
import cz.uhk.ppro.response.form.TestsCourses;
import cz.uhk.ppro.response.model.MobileTests;
import java.util.List;
import org.springframework.dao.DataAccessException;

/**
 *
 * @author Filip Valenta
 */
public interface DatabaseService {

    public List<Student> getStudenti() throws DataAccessException;
    public List<Student> getStudentiByLastName() throws DataAccessException;
    public List<Course> getKurzy() throws DataAccessException;
    public List<Teacher> getTeachers() throws DataAccessException;
    public List<Types> getTypes() throws DataAccessException;
    public List<Test> getTestsList() throws DataAccessException;
    public List<Student> getStudentsList() throws DataAccessException;

    public List<Question> getQuestions(Test t) throws DataAccessException;
    public List<Question> getQuestionsByIdTest(int id) throws DataAccessException;   //FOR mobile
    public List<Answer> getAnswers(Question q) throws DataAccessException;
    public List<Answer> getAnswersByQuestionId(int id) throws DataAccessException;  //FOR mobile
    public void pridejStudenta(Student s) throws DataAccessException;
    public void pridejKurz(Course c) throws DataAccessException;
    public void pridej(Test t) throws DataAccessException;
    public void pridej(Question q) throws DataAccessException;
    public void pridej(Answer a) throws DataAccessException;

    public void odstranKurz(int id) throws DataAccessException;
    public void odstranStudenta(int id) throws DataAccessException;
    public void odstranTest(int id) throws DataAccessException;
    public void odstranOtazku(int id) throws DataAccessException;
    public void odstranOdpoved(int id) throws DataAccessException;
    public void upravStudenta(Student s) throws DataAccessException;
    public void upravKurz(Course c) throws DataAccessException;
    public void upravTest(Test t) throws DataAccessException;
    public void upravOtazku(Question q) throws DataAccessException;
    public void upravOdpoved(Answer a) throws DataAccessException;
    public Student getStudentById(int id) throws DataAccessException;
    public Course getCourseById(int id) throws DataAccessException;
    public Test getTestById(int id) throws DataAccessException;
    public Question getQuestionById(int id) throws DataAccessException;
    public Answer getAnswerById(int id) throws DataAccessException;
    public void formUlozOtazkyOpdovedi(Test t) throws DataAccessException;
    public void formEditOtazkyOpdovedi(Test t) throws DataAccessException;

    public void prolinkujKurzyTesty(TestsCourses tc) throws DataAccessException;
    public List<Integer> getTestsIdsConnectedByCourses(Course c) throws DataAccessException;
    public List<Test> getTestsConnectedByCourse(Course c) throws DataAccessException;

    public void prolinkujKurzyStudenty(StudentsCourses sc) throws DataAccessException;
    public List<Integer> getStudentsIdsConnectedByCourses(Course c) throws DataAccessException;
    public List<Student> getStudentsConnectedByCourse(Course c) throws DataAccessException;

    public List<Course> getCoursesAndStudents(Course c, Student s)throws DataAccessException;
    public List<Course> getCoursesAndTests(Course c, Test t)throws DataAccessException;
    public Teacher getLoggedTeacher() throws DataAccessException;
    public int getTestByCourseCount(Course c) throws DataAccessException;
    
    
    //Metody pro Android
    public List<Student> getStudentByUserAndPassword(String user, String password) throws DataAccessException;
    public List<Test> getTestsByUserId(int id) throws DataAccessException;

}
